﻿using System.Collections.Generic;
using System.Linq;
using Ewk.MachineLearning.Persistance.Domain;
using Ewk.Extensions;

namespace Ewk.MachineLearning.Persistance.DataAccess
{
    public static class StringExtensions
    {
        public static IEnumerable<Word> GetTextEntities(this string content, TextEntityRepository<Word> dataAccess)
        {
            return content.GetWords()
                .Select(dataAccess.GetOrCreateEntity);
        }
    }
}